package org.eCon.maven.generatorFactory;

import org.eCon.maven.plugin.unixBased.mac.MacGWTCompilePlugin;
import org.eCon.maven.plugin.unixBased.linux.LinuxGWTCompilePlugin;
import org.eCon.maven.plugin.windows.WindowsGWTCompilePlugin;
import org.eCon.maven.generatorFactory.IGWTCompilePluginGenerator;
import org.eCon.maven.iPlugin.ICompile;
/*
 * Copyright 2001-2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * User: eCon
 * Date: 04-Aug-2008
 * Time: 22:12:46
 */
public class GWTCompilePluginGeneratorImpl implements IGWTCompilePluginGenerator {

    public ICompile createPlugin(String os) {
        if (os == null)
            throw new IllegalArgumentException("OS param can not be null.");

        ICompile builder;
        if (os.equalsIgnoreCase("win") || os.equalsIgnoreCase("win32") || os.equalsIgnoreCase("windows")) {
            builder = new WindowsGWTCompilePlugin();
        } else if (os.equalsIgnoreCase("mac")) {
            builder = new MacGWTCompilePlugin();
        } else {
            builder = new LinuxGWTCompilePlugin();
        }

        return builder;
    }
}